package com.pan.script.pantrans.sentence.impl;

import com.pan.script.pantrans.sentence.Sentence;

import java.awt.*;
import java.util.List;

public class LoopSentence implements Sentence {
    int loopCount;
    List<Sentence> sentenceList;

    public LoopSentence(int loopCount) {
        this.loopCount = loopCount;
    }

    public int getLoopCount() {
        return loopCount;
    }

    public List<Sentence> getSentenceList() {
        return sentenceList;
    }

    public void setSentenceList(List<Sentence> sentenceList) {
        this.sentenceList = sentenceList;
    }

    @Override
    public void execute(Robot robot) {
        for (int i = 0; i < loopCount; i++) {
            for (Sentence sentence: sentenceList){
                sentence.execute(robot);
            }
        }
    }
}
